#include "SiuCommon.h"

GlobalEnvironment* gEnv = new GlobalEnvironment();
int main()
{
	HMODULE hm;
	//HMODULE hm = LoadLibrary("SiuRendererPTR.dll");
	//HMODULE hm = LoadLibrary("SiuRendererd3d9.dll");
	//hm = LoadLibrary("SiuRendererd3d11.dll");
	hm = LoadLibrary("SiuRendererd3d11_Self.dll");
	
	//myAdd func;
	if (hm)
	{
		ShowFunc m_pFuncGameStart = (ShowFunc)GetProcAddress(hm, "SiuModuleInitialize");
		m_pFuncGameStart(gEnv);
		gEnv->pRenderer->SetUp();
	}
	MSG msg;
	::ZeroMemory(&msg, sizeof(MSG));

	while (msg.message != WM_QUIT)
	{
		if (::PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
		{
			::TranslateMessage(&msg);
			::DispatchMessage(&msg);
		}
		else
		{
			gEnv->pRenderer->Update();
		}
	}
}
